<?php $access = $obj->access;?>
<div id="toolbar-box">
<?php if(isset($obj->add_status)){ ?><div id='status' style='padding:5px 0 0 15px;color:green;font-size:14px;'><?php echo $obj->add_status; ?></div><? } ?>
	<div class="toolbar" id="toolbar">
            <table class="toolbar">
                   <tr>
                       <?php if($access['allow_delete'] == true){ ?>
			<td class="button" id="toolbar-trash">
				<a href="#" onclick="delet('user');" class="toolbar">
				<span class="icon-32-trash" title="Видалити">
				</span>
				Видалити
				</a>
			</td>
                        <?php } if($access['allow_edit'] == true){ ?>
			<td class="button" id="toolbar-edit">
				<a href="#" onclick="edit('user');" class="toolbar">
				<span class="icon-32-edit" title="Редагувати">
				</span>
				Редагувати
				</a>
			</td>
                        <?php } if($access['allow_write'] == true){ ?>
			<td class="button" id="toolbar-new">
				<a  href="/admin/adduser.html" class="toolbar">
				<span class="icon-32-new" title="Створити">
				</span>
				Створити
				</a>
			</td>
                        <?php } ?>
		</tr>
              </table>
	</div>
	<div class="clear"></div>
</div>
<div class="clear"></div>
<table class="adminlist">
<thead>
<tr>
<td class="title" width='15px'>
</td>
<td class="title">
<strong>#</strong>
</td>
<td class="title">
<strong>ID</strong>
</td>
<td class="title">
<strong>Імя</strong>
</td>
<td class="title">
<strong>Логін</strong>
</td>
<td class="title">
<strong>Email</strong>
</td>
<td class="title">
<strong>Група</strong>
</td>
<td class="title" width="50px">
<strong>Статус</strong>
</td>
<td class="title" width="50px">
<strong>Редагувати</strong>
</td>
<td class="title">
<strong>Видалити</strong>
</td>
</tr>
</thead>
<tbody>
<?php
$i=1;
foreach($obj->users as $value){
?>
<tr id='row<?=$value["id"]?>'>
<td>
     <?php if($access['allow_delete'] == true && $value['Rights']<5 && $value["id"] != $obj->auth || $value['Rights']>=5 && $access['allow_super'] == true && $value["id"] != $obj->auth){ ?>
         <input type="checkbox" id="checkme<?=$i?>" value="<?=$value["id"]?>"/>
     <?php } ?>
</td>
<td width="5%"><?=$i?></td>
<td width="5%"><?=$value["id"]?></td>
<td><?=$value['real_name']?></td>
<td><?=$value['username']?></td>
<td><?=$value['email']?></td>
<td><?=$value['role']?></td>
<td align="center">
	<?php
         if($access['allow_off'] == true && $value['Rights']<5 || $value['Rights']>=5 && $access['allow_super'] == true){
            if(empty($value['activ'])){?>
                    <span style='cursor:pointer;' id='activ<?php echo $value["id"];?>' onclick="actions(<?php echo $value["id"];?>,'activ');" title="Увімкнути">
                    <img src="/public/images/admin/tick.png" border="0" alt="Включений" /></span>
            <?php }else{ ?>
                    <span style='cursor:pointer;' id='unactiv<?php echo $value["id"];?>' onclick="actions(<?php echo $value["id"];?>,'unactiv');" title="Вимкнути">
                    <img src="/public/images/admin/publish_x.png" border="0" alt="Відключений" /></span>
        <?php } } ?>
</td>
<td align="center">
    <?php if($access['allow_edit'] == true && $value['Rights']<5 || $value["id"] == Df_Auth::read("id") || $value['Rights']>=5 && $access['allow_super'] == true){ ?><a style='padding-left:5px;' href="/admin/useredit.html?id=<?=$value["id"]?>"><img src="/public/images/edit.png" border="0" width="16px" height="16px"></a><?php } ?>
</td>
<td>
    <?php if($access['allow_delete'] == true && $value['Rights']<5 || $value['Rights']>=5 && $access['allow_super'] == true){ ?><span style='padding-left:5px;cursor:pointer;' id='del_user<?php echo $value['id'];?>' onclick="actions(<?=$value['id']?>,'del_user');"><img src="/public/images/delete.jpg"  border="0" width="16px" height="16px"></span><?php } ?>
</td>
</tr>
<?php
$i++;
}
?>
</tbody>
</table>
